<%@ page import="projetjee.User" %>



<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'username', 'error')} required">
	<label for="username">
		<g:message code="user.username.label" default="Username" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="username" required="" value="${userInstance?.username}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'password', 'error')} required">
	<label for="password">
		<g:message code="user.password.label" default="Password" />
		<span class="required-indicator">*</span>
	</label>
	<g:passwordField name="password" required="" value="${userInstance?.password}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'nom', 'error')} required">
	<label for="nom">
		<g:message code="user.nom.label" default="Nom" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="nom" required="" value="${userInstance?.nom}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'prenom', 'error')} required">
	<label for="prenom">
		<g:message code="user.prenom.label" default="Prenom" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="prenom" required="" value="${userInstance?.prenom}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'mail', 'error')} required">
	<label for="mail">
		<g:message code="user.mail.label" default="Mail" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="email" name="mail" required="" value="${userInstance?.mail}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'sexe', 'error')} ">
	<label for="sexe">
		<g:message code="user.sexe.label" default="Sexe" />
		
	</label>
	<g:select name="sexe" from="${userInstance.constraints.sexe.inList}" value="${userInstance?.sexe}" valueMessagePrefix="user.sexe" noSelection="['': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'dateNaissance', 'error')} required">
	<label for="dateNaissance">
		<g:message code="user.dateNaissance.label" default="Date Naissance" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="dateNaissance" precision="day"  value="${userInstance?.dateNaissance}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'photoProfil', 'error')} required">
	<label for="photoProfil">
		<g:message code="user.photoProfil.label" default="Photo Profil" />
		<span class="required-indicator">*</span>
	</label>
	<input type="file" id="photoProfil" name="photoProfil" />
</div>

<%--<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'vote', 'error')} required">
	<label for="vote">
		<g:message code="user.vote.label" default="Vote" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="vote" required="" value="${fieldValue(bean: userInstance, field: 'vote')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'accountExpired', 'error')} ">
	<label for="accountExpired">
		<g:message code="user.accountExpired.label" default="Account Expired" />
		
	</label>
	<g:checkBox name="accountExpired" value="${userInstance?.accountExpired}" />
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'accountLocked', 'error')} ">
	<label for="accountLocked">
		<g:message code="user.accountLocked.label" default="Account Locked" />
		
	</label>
	<g:checkBox name="accountLocked" value="${userInstance?.accountLocked}" />
</div>--%>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'bio', 'error')} ">
	<label for="bio">
		<g:message code="user.bio.label" default="Bio" />
		
	</label>
	<g:textField name="bio" value="${userInstance?.bio}"/>
</div>

<%--<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'centreInteret', 'error')} ">
	<label for="centreInteret">
		<g:message code="user.centreInteret.label" default="Centre Interet" />
		
	</label>
	<g:select name="centreInteret" from="${projetjee.Activite.list()}" multiple="multiple" optionKey="id" size="5" value="${userInstance?.centreInteret*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'enabled', 'error')} ">
	<label for="enabled">
		<g:message code="user.enabled.label" default="Enabled" />
		
	</label>
	<g:checkBox name="enabled" value="${userInstance?.enabled}" />
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'passwordExpired', 'error')} ">
	<label for="passwordExpired">
		<g:message code="user.passwordExpired.label" default="Password Expired" />
		
	</label>
	<g:checkBox name="passwordExpired" value="${userInstance?.passwordExpired}" />
</div>


<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'relations', 'error')} ">
	<label for="relations">
		<g:message code="user.relations.label" default="Relations" />
		
	</label>
	<g:select name="relations" from="${projetjee.Relationship.list()}" multiple="multiple" optionKey="id" size="5" value="${userInstance?.relations*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'relationsSubscriptions', 'error')} ">
	<label for="relationsSubscriptions">
		<g:message code="user.relationsSubscriptions.label" default="Relations Subscriptions" />
		
	</label>
	<g:select name="relationsSubscriptions" from="${projetjee.Relationship.list()}" multiple="multiple" optionKey="id" size="5" value="${userInstance?.relationsSubscriptions*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'userTag', 'error')} ">
	<label for="userTag">
		<g:message code="user.userTag.label" default="User Tag" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${userInstance?.userTag?}" var="u">
    <li><g:link controller="photoTaggee" action="show" id="${u.id}">${u?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="photoTaggee" action="create" params="['user.id': userInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'photoTaggee.label', default: 'PhotoTaggee')])}</g:link>
</li>
</ul>

</div>--%>